﻿@model PaymentHelper.Methods.PaypalStandard.Models.PaymentCompleteModel
           
<div class="ph_payment_container">
    @if (Model.PaymentStatus.Equals("Completed", StringComparison.InvariantCultureIgnoreCase))
    {
        <p>
            @ViewBag.Resources["PaypalStandard.SuccessMessage"]
        </p>       
    }
    <h3>@ViewBag.Resources["PaypalStandard.DetailResult"]</h3>
    <table>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PayerId"]
            </td>
            <td class="value">@Model.PayerId
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PayerFirstName"]
            </td>
            <td class="value">@Model.PayerFirstName
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PayerLastName"]
            </td>
            <td class="value">@Model.PayerLastName
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PaymentDate"]
            </td>
            <td class="value">@Model.PaymentDate
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PaymentFee"]
            </td>
            <td class="value">@Model.PaymentFee
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PaymentGross"]
            </td>
            <td class="value">@Model.PaymentGross
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PaymentCurrency"]
            </td>
            <td class="value">@Model.PaymentCurrency
            </td>
        </tr>
        <tr>
            <td class="label">@ViewBag.Resources["PaypalStandard.PaymentStatus"]
            </td>
            <td class="value">@Model.PaymentStatus
            </td>
        </tr>
    </table>
    <div id="ph_redirectToProcessResult">
        <p>
            @ViewBag.Resources["PaypalStandard.WaitingMessage"] <span id="ph_redirectToProcessResultTime"
                style="font-weight: bold;">10</span> s.
        </p>
        <p>
            <a href="@ViewBag.ProcessResultUrl" id="ph_linkToProcess">@ViewBag.Resources["PaypalStandard.NavigateNow"]</a>
        </p>
    </div>
</div>
<script type="text/javascript">

    window.onload = countDown();

    function countDown() {
        var time = $('#ph_redirectToProcessResultTime').html();

        if (time <= 0) {
            location.href = $('#ph_linkToProcess').attr("href");
        } else {
            time = time - 1;
            $('#ph_redirectToProcessResultTime').html(time);
            setTimeout("countDown()", 1000);
        }
    }
</script>
